home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / icon32 / icon32.frm (.txt) next >
Encoding:
Visual Basic Form  |  1998-11-11  |  46.3 KB  |  1,546 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
  3. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
  4. Begin VB.Form frmMain 
  5.    BackColor       =   &H8000000A&
  6.    Caption         =   "Icon32 - Untitled"
  7.    ClientHeight    =   6480
  8.    ClientLeft      =   60
  9.    ClientTop       =   630
  10.    ClientWidth     =   8190
  11.    Icon            =   "icon32.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   6480
  14.    ScaleWidth      =   8190
  15.    Begin VB.CommandButton cmdFont 
  16.       Caption         =   "MS Sans Serif"
  17.       Height          =   375
  18.       Left            =   5640
  19.       TabIndex        =   87
  20.       Top             =   600
  21.       Width           =   2295
  22.    End
  23.    Begin ComctlLib.StatusBar SBar 
  24.       Align           =   2  'Align Bottom
  25.       Height          =   255
  26.       Left            =   0
  27.       TabIndex        =   77
  28.       Top             =   6225
  29.       Width           =   8190
  30.       _ExtentX        =   14446
  31.       _ExtentY        =   450
  32.       SimpleText      =   ""
  33.       _Version        =   327682
  34.       BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7} 
  35.          NumPanels       =   1
  36.          BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  37.             Object.Tag             =   ""
  38.          EndProperty
  39.       EndProperty
  40.    End
  41.    Begin VB.Frame Frame3 
  42.       Caption         =   "Shift Image"
  43.       Height          =   2055
  44.       Left            =   6000
  45.       TabIndex        =   68
  46.       ToolTipText     =   "Shifts Entire Image"
  47.       Top             =   3840
  48.       Width           =   2100
  49.       Begin VB.CommandButton cmdShift 
  50.          Caption         =   "&R"
  51.          Height          =   495
  52.          Index           =   0
  53.          Left            =   1440
  54.          TabIndex        =   76
  55.          Top             =   840
  56.          Width           =   495
  57.       End
  58.       Begin VB.CommandButton cmdShift 
  59.          Caption         =   "&L"
  60.          Height          =   495
  61.          Index           =   1
  62.          Left            =   240
  63.          TabIndex        =   75
  64.          Top             =   840
  65.          Width           =   495
  66.       End
  67.       Begin VB.CommandButton cmdShift 
  68.          Caption         =   "&U"
  69.          Height          =   495
  70.          Index           =   2
  71.          Left            =   840
  72.          TabIndex        =   74
  73.          Top             =   240
  74.          Width           =   495
  75.       End
  76.       Begin VB.CommandButton cmdShift 
  77.          Caption         =   "&D"
  78.          Height          =   495
  79.          Index           =   3
  80.          Left            =   840
  81.          TabIndex        =   73
  82.          Top             =   1440
  83.          Width           =   495
  84.       End
  85.       Begin VB.CommandButton cmdShift 
  86.          Caption         =   "UL"
  87.          Height          =   495
  88.          Index           =   4
  89.          Left            =   240
  90.          TabIndex        =   72
  91.          Top             =   240
  92.          Width           =   495
  93.       End
  94.       Begin VB.CommandButton cmdShift 
  95.          Caption         =   "UR"
  96.          Height          =   495
  97.          Index           =   5
  98.          Left            =   1440
  99.          TabIndex        =   71
  100.          Top             =   240
  101.          Width           =   495
  102.       End
  103.       Begin VB.CommandButton cmdShift 
  104.          Caption         =   "DL"
  105.          Height          =   495
  106.          Index           =   6
  107.          Left            =   240
  108.          TabIndex        =   70
  109.          Top             =   1440
  110.          Width           =   495
  111.       End
  112.       Begin VB.CommandButton cmdShift 
  113.          Caption         =   "DR"
  114.          Height          =   495
  115.          Index           =   7
  116.          Left            =   1440
  117.          TabIndex        =   69
  118.          Top             =   1440
  119.          Width           =   495
  120.       End
  121.    End
  122.    Begin VB.Frame Frame2 
  123.       Caption         =   "Mode"
  124.       Height          =   975
  125.       Left            =   0
  126.       TabIndex        =   66
  127.       Top             =   120
  128.       Width           =   855
  129.       Begin VB.PictureBox picMode 
  130.          Appearance      =   0  'Flat
  131.          AutoRedraw      =   -1  'True
  132.          BackColor       =   &H80000005&
  133.          ForeColor       =   &H80000008&
  134.          Height          =   540
  135.          Left            =   150
  136.          ScaleHeight     =   34
  137.          ScaleMode       =   0  'User
  138.          ScaleWidth      =   34
  139.          TabIndex        =   67
  140.          ToolTipText     =   "Displays Selected Mode"
  141.          Top             =   240
  142.          Width           =   540
  143.       End
  144.    End
  145.    Begin VB.Frame Frame1 
  146.       Caption         =   "Mode Select"
  147.       Height          =   975
  148.       Left            =   960
  149.       TabIndex        =   65
  150.       Top             =   120
  151.       Width           =   4575
  152.       Begin VB.PictureBox picModeSel 
  153.          Height          =   540
  154.          Index           =   8
  155.          Left            =   3960
  156.          Picture         =   "icon32.frx":030A
  157.          ScaleHeight     =   480
  158.          ScaleWidth      =   480
  159.          TabIndex        =   86
  160.          ToolTipText     =   "Capture (Select Region) Mode"
  161.          Top             =   240
  162.          Width           =   540
  163.       End
  164.       Begin VB.PictureBox picModeSel 
  165.          Height          =   540
  166.          Index           =   7
  167.          Left            =   3480
  168.          Picture         =   "icon32.frx":0614
  169.          ScaleHeight     =   480
  170.          ScaleWidth      =   480
  171.          TabIndex        =   85
  172.          ToolTipText     =   "Color Fill Mode"
  173.          Top             =   240
  174.          Width           =   540
  175.       End
  176.       Begin VB.PictureBox picModeSel 
  177.          Height          =   540
  178.          Index           =   6
  179.          Left            =   3000
  180.          Picture         =   "icon32.frx":091E
  181.          ScaleHeight     =   480
  182.          ScaleWidth      =   480
  183.          TabIndex        =   84
  184.          ToolTipText     =   "Text Mode"
  185.          Top             =   240
  186.          Width           =   540
  187.       End
  188.       Begin VB.PictureBox picModeSel 
  189.          Height          =   540
  190.          Index           =   5
  191.          Left            =   2520
  192.          Picture         =   "icon32.frx":0C28
  193.          ScaleHeight     =   480
  194.          ScaleWidth      =   480
  195.          TabIndex        =   83
  196.          ToolTipText     =   "Filled Circle Mode"
  197.          Top             =   240
  198.          Width           =   540
  199.       End
  200.       Begin VB.PictureBox picModeSel 
  201.          Height          =   540
  202.          Index           =   4
  203.          Left            =   2040
  204.          Picture         =   "icon32.frx":0F32
  205.          ScaleHeight     =   480
  206.          ScaleWidth      =   480
  207.          TabIndex        =   82
  208.          ToolTipText     =   "Circle Mode"
  209.          Top             =   240
  210.          Width           =   540
  211.       End
  212.       Begin VB.PictureBox picModeSel 
  213.          Height          =   540
  214.          Index           =   3
  215.          Left            =   1560
  216.          Picture         =   "icon32.frx":123C
  217.          ScaleHeight     =   480
  218.          ScaleWidth      =   480
  219.          TabIndex        =   81
  220.          ToolTipText     =   "Filled Rectangle Mode"
  221.          Top             =   240
  222.          Width           =   540
  223.       End
  224.       Begin VB.PictureBox picModeSel 
  225.          Height          =   540
  226.          Index           =   2
  227.          Left            =   1080
  228.          Picture         =   "icon32.frx":1546
  229.          ScaleHeight     =   480
  230.          ScaleWidth      =   480
  231.          TabIndex        =   80
  232.          ToolTipText     =   "Rectangle Mode"
  233.          Top             =   240
  234.          Width           =   540
  235.       End
  236.       Begin VB.PictureBox picModeSel 
  237.          Height          =   540
  238.          Index           =   1
  239.          Left            =   600
  240.          Picture         =   "icon32.frx":1850
  241.          ScaleHeight     =   480
  242.          ScaleWidth      =   480
  243.          TabIndex        =   79
  244.          ToolTipText     =   "Line Mode"
  245.          Top             =   240
  246.          Width           =   540
  247.       End
  248.       Begin VB.PictureBox picModeSel 
  249.          Height          =   540
  250.          Index           =   0
  251.          Left            =   120
  252.          Picture         =   "icon32.frx":1B5A
  253.          ScaleHeight     =   480
  254.          ScaleWidth      =   480
  255.          TabIndex        =   78
  256.          ToolTipText     =   "Pencil Mode (mouse with any shift key draws straight line)"
  257.          Top             =   240
  258.          Width           =   540
  259.       End
  260.    End
  261.    Begin VB.PictureBox Color 
  262.       BackColor       =   &H00FFFFFF&
  263.       Height          =   255
  264.       Index           =   47
  265.       Left            =   5640
  266.       ScaleHeight     =   195
  267.       ScaleWidth      =   195
  268.       TabIndex        =   64
  269.       Top             =   4080
  270.       Width           =   255
  271.    End
  272.    Begin VB.PictureBox Color 
  273.       BackColor       =   &H00FFFFFF&
  274.       Height          =   255
  275.       Index           =   46
  276.       Left            =   5640
  277.       ScaleHeight     =   195
  278.       ScaleWidth      =   195
  279.       TabIndex        =   63
  280.       Top             =   3840
  281.       Width           =   255
  282.    End
  283.    Begin VB.PictureBox Color 
  284.       BackColor       =   &H00FFFFFF&
  285.       Height          =   255
  286.       Index           =   45
  287.       Left            =   5640
  288.       ScaleHeight     =   195
  289.       ScaleWidth      =   195
  290.       TabIndex        =   62
  291.       Top             =   4320
  292.       Width           =   255
  293.    End
  294.    Begin VB.PictureBox Color 
  295.       BackColor       =   &H00FFFFFF&
  296.       Height          =   255
  297.       Index           =   44
  298.       Left            =   5400
  299.       ScaleHeight     =   195
  300.       ScaleWidth      =   195
  301.       TabIndex        =   61
  302.       Top             =   3840
  303.       Width           =   255
  304.    End
  305.    Begin VB.PictureBox Color 
  306.       BackColor       =   &H00FFFFFF&
  307.       Height          =   255
  308.       Index           =   43
  309.       Left            =   5400
  310.       ScaleHeight     =   195
  311.       ScaleWidth      =   195
  312.       TabIndex        =   60
  313.       Top             =   4080
  314.       Width           =   255
  315.    End
  316.    Begin VB.PictureBox Color 
  317.       BackColor       =   &H00FFFFFF&
  318.       Height          =   255
  319.       Index           =   42
  320.       Left            =   5160
  321.       ScaleHeight     =   195
  322.       ScaleWidth      =   195
  323.       TabIndex        =   59
  324.       Top             =   4320
  325.       Width           =   255
  326.    End
  327.    Begin VB.PictureBox Color 
  328.       BackColor       =   &H00FFFFFF&
  329.       Height          =   255
  330.       Index           =   41
  331.       Left            =   4920
  332.       ScaleHeight     =   195
  333.       ScaleWidth      =   195
  334.       TabIndex        =   58
  335.       Top             =   4080
  336.       Width           =   255
  337.    End
  338.    Begin VB.PictureBox Color 
  339.       BackColor       =   &H00FFFFFF&
  340.       Height          =   255
  341.       Index           =   40
  342.       Left            =   5400
  343.       ScaleHeight     =   195
  344.       ScaleWidth      =   195
  345.       TabIndex        =   57
  346.       Top             =   4320
  347.       Width           =   255
  348.    End
  349.    Begin VB.PictureBox Color 
  350.       BackColor       =   &H00FFFFFF&
  351.       Height          =   255
  352.       Index           =   39
  353.       Left            =   4920
  354.       ScaleHeight     =   195
  355.       ScaleWidth      =   195
  356.       TabIndex        =   56
  357.       Top             =   4320
  358.       Width           =   255
  359.    End
  360.    Begin VB.PictureBox Color 
  361.       BackColor       =   &H00FFFFFF&
  362.       Height          =   255
  363.       Index           =   38
  364.       Left            =   5160
  365.       ScaleHeight     =   195
  366.       ScaleWidth      =   195
  367.       TabIndex        =   55
  368.       Top             =   4080
  369.       Width           =   255
  370.    End
  371.    Begin VB.PictureBox Color 
  372.       BackColor       =   &H00FFFFFF&
  373.       Height          =   255
  374.       Index           =   37
  375.       Left            =   4920
  376.       ScaleHeight     =   195
  377.       ScaleWidth      =   195
  378.       TabIndex        =   54
  379.       Top             =   3840
  380.       Width           =   255
  381.    End
  382.    Begin VB.PictureBox Color 
  383.       BackColor       =   &H00FFFFFF&
  384.       Height          =   255
  385.       Index           =   36
  386.       Left            =   5160
  387.       ScaleHeight     =   195
  388.       ScaleWidth      =   195
  389.       TabIndex        =   53
  390.       Top             =   3840
  391.       Width           =   255
  392.    End
  393.    Begin VB.PictureBox Color 
  394.       BackColor       =   &H00FFFFFF&
  395.       Height          =   255
  396.       Index           =   35
  397.       Left            =   4920
  398.       ScaleHeight     =   195
  399.       ScaleWidth      =   195
  400.       TabIndex        =   52
  401.       Top             =   4560
  402.       Width           =   255
  403.    End
  404.    Begin VB.PictureBox Color 
  405.       BackColor       =   &H00FFFFFF&
  406.       Height          =   255
  407.       Index           =   34
  408.       Left            =   5160
  409.       ScaleHeight     =   195
  410.       ScaleWidth      =   195
  411.       TabIndex        =   51
  412.       Top             =   4560
  413.       Width           =   255
  414.    End
  415.    Begin VB.PictureBox Color 
  416.       BackColor       =   &H00FFFFFF&
  417.       Height          =   255
  418.       Index           =   33
  419.       Left            =   5400
  420.       ScaleHeight     =   195
  421.       ScaleWidth      =   195
  422.       TabIndex        =   50
  423.       Top             =   4560
  424.       Width           =   255
  425.    End
  426.    Begin VB.PictureBox Color 
  427.       BackColor       =   &H00FFFFFF&
  428.       Height          =   255
  429.       Index           =   32
  430.       Left            =   5640
  431.       ScaleHeight     =   195
  432.       ScaleWidth      =   195
  433.       TabIndex        =   49
  434.       Top             =   4560
  435.       Width           =   255
  436.    End
  437.    Begin VB.PictureBox Color 
  438.       BackColor       =   &H0000C0C0&
  439.       Height          =   255
  440.       Index           =   31
  441.       Left            =   5400
  442.       ScaleHeight     =   195
  443.       ScaleWidth      =   195
  444.       TabIndex        =   48
  445.       Top             =   3240
  446.       Width           =   255
  447.    End
  448.    Begin VB.PictureBox Color 
  449.       BackColor       =   &H000000C0&
  450.       Height          =   255
  451.       Index           =   30
  452.       Left            =   5160
  453.       ScaleHeight     =   195
  454.       ScaleWidth      =   195
  455.       TabIndex        =   47
  456.       Top             =   3480
  457.       Width           =   255
  458.    End
  459.    Begin VB.PictureBox Color 
  460.       BackColor       =   &H000040C0&
  461.       Height          =   255
  462.       Index           =   29
  463.       Left            =   5400
  464.       ScaleHeight     =   195
  465.       ScaleWidth      =   195
  466.       TabIndex        =   46
  467.       Top             =   3480
  468.       Width           =   255
  469.    End
  470.    Begin VB.PictureBox Color 
  471.       BackColor       =   &H00004080&
  472.       Height          =   255
  473.       Index           =   28
  474.       Left            =   5160
  475.       ScaleHeight     =   195
  476.       ScaleWidth      =   315
  477.       TabIndex        =   45
  478.       Top             =   3240
  479.       Width           =   375
  480.    End
  481.    Begin VB.PictureBox Color 
  482.       BackColor       =   &H00C0E0FF&
  483.       Height          =   255
  484.       Index           =   27
  485.       Left            =   5160
  486.       ScaleHeight     =   195
  487.       ScaleWidth      =   195
  488.       TabIndex        =   44
  489.       Top             =   2760
  490.       Width           =   255
  491.    End
  492.    Begin VB.PictureBox Color 
  493.       BackColor       =   &H00FFC0C0&
  494.       Height          =   255
  495.       Index           =   26
  496.       Left            =   4920
  497.       ScaleHeight     =   195
  498.       ScaleWidth      =   195
  499.       TabIndex        =   43
  500.       Top             =   3000
  501.       Width           =   255
  502.    End
  503.    Begin VB.PictureBox Color 
  504.       BackColor       =   &H00C00000&
  505.       Height          =   255
  506.       Index           =   25
  507.       Left            =   4920
  508.       ScaleHeight     =   195
  509.       ScaleWidth      =   195
  510.       TabIndex        =   42
  511.       Top             =   3480
  512.       Width           =   255
  513.    End
  514.    Begin VB.PictureBox Color 
  515.       BackColor       =   &H00000080&
  516.       Height          =   255
  517.       Index           =   24
  518.       Left            =   4920
  519.       ScaleHeight     =   195
  520.       ScaleWidth      =   195
  521.       TabIndex        =   41
  522.       Top             =   3240
  523.       Width           =   255
  524.    End
  525.    Begin VB.PictureBox Color 
  526.       BackColor       =   &H00800000&
  527.       Height          =   255
  528.       Index           =   23
  529.       Left            =   5640
  530.       ScaleHeight     =   195
  531.       ScaleWidth      =   195
  532.       TabIndex        =   40
  533.       Top             =   3480
  534.       Width           =   255
  535.    End
  536.    Begin VB.PictureBox Color 
  537.       BackColor       =   &H00C0C0FF&
  538.       Height          =   255
  539.       Index           =   22
  540.       Left            =   4920
  541.       ScaleHeight     =   195
  542.       ScaleWidth      =   195
  543.       TabIndex        =   39
  544.       Top             =   2760
  545.       Width           =   255
  546.    End
  547.    Begin VB.PictureBox Color 
  548.       BackColor       =   &H00C0FFFF&
  549.       Height          =   255
  550.       Index           =   21
  551.       Left            =   5400
  552.       ScaleHeight     =   195
  553.       ScaleWidth      =   195
  554.       TabIndex        =   38
  555.       Top             =   2760
  556.       Width           =   255
  557.    End
  558.    Begin VB.PictureBox Color 
  559.       BackColor       =   &H00C0FFC0&
  560.       Height          =   255
  561.       Index           =   20
  562.       Left            =   5640
  563.       ScaleHeight     =   195
  564.       ScaleWidth      =   195
  565.       TabIndex        =   37
  566.       Top             =   2760
  567.       Width           =   255
  568.    End
  569.    Begin VB.PictureBox Color 
  570.       BackColor       =   &H008080FF&
  571.       Height          =   255
  572.       Index           =   19
  573.       Left            =   5160
  574.       ScaleHeight     =   195
  575.       ScaleWidth      =   195
  576.       TabIndex        =   36
  577.       Top             =   3000
  578.       Width           =   255
  579.    End
  580.    Begin VB.PictureBox Color 
  581.       BackColor       =   &H0080C0FF&
  582.       Height          =   255
  583.       Index           =   18
  584.       Left            =   5400
  585.       ScaleHeight     =   195
  586.       ScaleWidth      =   195
  587.       TabIndex        =   35
  588.       Top             =   3000
  589.       Width           =   255
  590.    End
  591.    Begin VB.PictureBox Color 
  592.       BackColor       =   &H0080FFFF&
  593.       Height          =   255
  594.       Index           =   17
  595.       Left            =   5640
  596.       ScaleHeight     =   195
  597.       ScaleWidth      =   195
  598.       TabIndex        =   34
  599.       Top             =   3000
  600.       Width           =   255
  601.    End
  602.    Begin VB.PictureBox Color 
  603.       BackColor       =   &H0000C000&
  604.       Height          =   255
  605.       Index           =   16
  606.       Left            =   5640
  607.       ScaleHeight     =   195
  608.       ScaleWidth      =   195
  609.       TabIndex        =   33
  610.       Top             =   3240
  611.       Width           =   255
  612.    End
  613.    Begin VB.CommandButton cmdFlipV 
  614.       Caption         =   "Flip V"
  615.       Height          =   375
  616.       Left            =   6960
  617.       TabIndex        =   31
  618.       ToolTipText     =   "Flip Vertically"
  619.       Top             =   3000
  620.       Width           =   855
  621.    End
  622.    Begin VB.CommandButton cmdFlipH 
  623.       Caption         =   "Flip H"
  624.       Height          =   375
  625.       Left            =   6000
  626.       TabIndex        =   30
  627.       ToolTipText     =   "Flips Horizontally"
  628.       Top             =   3000
  629.       Width           =   855
  630.    End
  631.    Begin VB.CommandButton cmdRotate 
  632.       Caption         =   "Rotate"
  633.       Height          =   375
  634.       Left            =   6000
  635.       TabIndex        =   29
  636.       ToolTipText     =   "Rotate Image"
  637.       Top             =   2400
  638.       Width           =   855
  639.    End
  640.    Begin VB.PictureBox picCap 
  641.       AutoRedraw      =   -1  'True
  642.       BackColor       =   &H80000009&
  643.       Height          =   540
  644.       Left            =   4920
  645.       ScaleHeight     =   32
  646.       ScaleMode       =   3  'Pixel
  647.       ScaleWidth      =   32
  648.       TabIndex        =   27
  649.       Top             =   5400
  650.       Width           =   540
  651.    End
  652.    Begin VB.CommandButton cmdPaste 
  653.       Enabled         =   0   'False
  654.       Height          =   375
  655.       Left            =   6960
  656.       Picture         =   "icon32.frx":1E64
  657.       Style           =   1  'Graphical
  658.       TabIndex        =   26
  659.       ToolTipText     =   "Pastes Clipboard to Mouseclick Position"
  660.       Top             =   2400
  661.       Width           =   855
  662.    End
  663.    Begin VB.CommandButton cmdCopy 
  664.       Enabled         =   0   'False
  665.       Height          =   375
  666.       Left            =   6960
  667.       Picture         =   "icon32.frx":2396
  668.       Style           =   1  'Graphical
  669.       TabIndex        =   25
  670.       ToolTipText     =   "Copies Selected Area to Clipboard"
  671.       Top             =   1800
  672.       Width           =   855
  673.    End
  674.    Begin VB.CommandButton cmdCut 
  675.       Enabled         =   0   'False
  676.       Height          =   375
  677.       Left            =   6960
  678.       Picture         =   "icon32.frx":28C8
  679.       Style           =   1  'Graphical
  680.       TabIndex        =   24
  681.       ToolTipText     =   "Cuts selected area and copies to clipboard"
  682.       Top             =   1200
  683.       Width           =   855
  684.    End
  685.    Begin VB.CommandButton cmdGrid 
  686.       Caption         =   "&Grid"
  687.       Height          =   375
  688.       Left            =   6000
  689.       TabIndex        =   23
  690.       ToolTipText     =   "Toggles Grid"
  691.       Top             =   1800
  692.       Width           =   855
  693.    End
  694.    Begin VB.TextBox txtAlpha 
  695.       Height          =   285
  696.       Left            =   6120
  697.       TabIndex        =   22
  698.       Top             =   240
  699.       Width           =   1455
  700.    End
  701.    Begin VB.CommandButton cmdClear 
  702.       Caption         =   "&Clear"
  703.       Height          =   375
  704.       Left            =   6000
  705.       TabIndex        =   20
  706.       ToolTipText     =   "Clear to Left or Right Color"
  707.       Top             =   1200
  708.       Width           =   855
  709.    End
  710.    Begin MSComDlg.CommonDialog cd 
  711.       Left            =   4320
  712.       Top             =   5880
  713.       _ExtentX        =   847
  714.       _ExtentY        =   847
  715.       _Version        =   327681
  716.    End
  717.    Begin VB.PictureBox Ikon 
  718.       AutoRedraw      =   -1  'True
  719.       BackColor       =   &H80000009&
  720.       Height          =   540
  721.       Left            =   4920
  722.       ScaleHeight     =   32
  723.       ScaleMode       =   3  'Pixel
  724.       ScaleWidth      =   32
  725.       TabIndex        =   19
  726.       Top             =   4920
  727.       Width           =   540
  728.    End
  729.    Begin VB.PictureBox Color 
  730.       BackColor       =   &H00FF80FF&
  731.       Height          =   255
  732.       Index           =   15
  733.       Left            =   5640
  734.       ScaleHeight     =   195
  735.       ScaleWidth      =   195
  736.       TabIndex        =   18
  737.       Top             =   2400
  738.       Width           =   255
  739.    End
  740.    Begin VB.PictureBox Color 
  741.       BackColor       =   &H00FF8080&
  742.       Height          =   255
  743.       Index           =   14
  744.       Left            =   5400
  745.       ScaleHeight     =   195
  746.       ScaleWidth      =   195
  747.       TabIndex        =   17
  748.       Top             =   2400
  749.       Width           =   255
  750.    End
  751.    Begin VB.PictureBox Color 
  752.       BackColor       =   &H00FFFF80&
  753.       Height          =   255
  754.       Index           =   13
  755.       Left            =   5160
  756.       ScaleHeight     =   195
  757.       ScaleWidth      =   195
  758.       TabIndex        =   16
  759.       Top             =   2400
  760.       Width           =   255
  761.    End
  762.    Begin VB.PictureBox Color 
  763.       BackColor       =   &H0080FF80&
  764.       Height          =   255
  765.       Index           =   12
  766.       Left            =   4920
  767.       ScaleHeight     =   195
  768.       ScaleWidth      =   195
  769.       TabIndex        =   15
  770.       Top             =   2400
  771.       Width           =   255
  772.    End
  773.    Begin VB.PictureBox Color 
  774.       BackColor       =   &H0080FFFF&
  775.       Height          =   255
  776.       Index           =   11
  777.       Left            =   5640
  778.       ScaleHeight     =   195
  779.       ScaleWidth      =   195
  780.       TabIndex        =   14
  781.       Top             =   2160
  782.       Width           =   255
  783.    End
  784.    Begin VB.PictureBox Color 
  785.       BackColor       =   &H0080C0FF&
  786.       Height          =   255
  787.       Index           =   10
  788.       Left            =   5400
  789.       ScaleHeight     =   195
  790.       ScaleWidth      =   195
  791.       TabIndex        =   13
  792.       Top             =   2160
  793.       Width           =   255
  794.    End
  795.    Begin VB.PictureBox Color 
  796.       BackColor       =   &H008080FF&
  797.       Height          =   255
  798.       Index           =   9
  799.       Left            =   5160
  800.       ScaleHeight     =   195
  801.       ScaleWidth      =   195
  802.       TabIndex        =   12
  803.       Top             =   2160
  804.       Width           =   255
  805.    End
  806.    Begin VB.PictureBox Color 
  807.       BackColor       =   &H00E0E0E0&
  808.       Height          =   255
  809.       Index           =   8
  810.       Left            =   4920
  811.       ScaleHeight     =   195
  812.       ScaleWidth      =   195
  813.       TabIndex        =   11
  814.       Top             =   2160
  815.       Width           =   255
  816.    End
  817.    Begin VB.PictureBox Color 
  818.       BackColor       =   &H00FFC0C0&
  819.       Height          =   255
  820.       Index           =   7
  821.       Left            =   5640
  822.       ScaleHeight     =   195
  823.       ScaleWidth      =   195
  824.       TabIndex        =   10
  825.       Top             =   1920
  826.       Width           =   255
  827.    End
  828.    Begin VB.PictureBox Color 
  829.       BackColor       =   &H00FFC0FF&
  830.       Height          =   255
  831.       Index           =   6
  832.       Left            =   5400
  833.       ScaleHeight     =   195
  834.       ScaleWidth      =   195
  835.       TabIndex        =   9
  836.       Top             =   1920
  837.       Width           =   255
  838.    End
  839.    Begin VB.PictureBox Color 
  840.       BackColor       =   &H00FFFFC0&
  841.       Height          =   255
  842.       Index           =   5
  843.       Left            =   5160
  844.       ScaleHeight     =   195
  845.       ScaleWidth      =   195
  846.       TabIndex        =   8
  847.       Top             =   1920
  848.       Width           =   255
  849.    End
  850.    Begin VB.PictureBox Color 
  851.       BackColor       =   &H00C0FFC0&
  852.       Height          =   255
  853.       Index           =   4
  854.       Left            =   4920
  855.       ScaleHeight     =   195
  856.       ScaleWidth      =   195
  857.       TabIndex        =   7
  858.       Top             =   1920
  859.       Width           =   255
  860.    End
  861.    Begin VB.PictureBox Color 
  862.       BackColor       =   &H00C0FFFF&
  863.       Height          =   255
  864.       Index           =   3
  865.       Left            =   5640
  866.       ScaleHeight     =   195
  867.       ScaleWidth      =   195
  868.       TabIndex        =   6
  869.       Top             =   1680
  870.       Width           =   255
  871.    End
  872.    Begin VB.PictureBox Color 
  873.       BackColor       =   &H00C0E0FF&
  874.       Height          =   255
  875.       Index           =   2
  876.       Left            =   5400
  877.       ScaleHeight     =   195
  878.       ScaleWidth      =   195
  879.       TabIndex        =   5
  880.       Top             =   1680
  881.       Width           =   255
  882.    End
  883.    Begin VB.PictureBox Color 
  884.       BackColor       =   &H00C0C0FF&
  885.       Height          =   255
  886.       Index           =   1
  887.       Left            =   5160
  888.       ScaleHeight     =   195
  889.       ScaleWidth      =   195
  890.       TabIndex        =   4
  891.       Top             =   1680
  892.       Width           =   255
  893.    End
  894.    Begin VB.PictureBox Color 
  895.       BackColor       =   &H00FFFFFF&
  896.       Height          =   255
  897.       Index           =   0
  898.       Left            =   4920
  899.       ScaleHeight     =   195
  900.       ScaleWidth      =   195
  901.       TabIndex        =   3
  902.       Top             =   1680
  903.       Width           =   255
  904.    End
  905.    Begin VB.PictureBox RightColor 
  906.       BackColor       =   &H80000009&
  907.       Height          =   495
  908.       Left            =   5400
  909.       ScaleHeight     =   435
  910.       ScaleWidth      =   435
  911.       TabIndex        =   2
  912.       ToolTipText     =   "Right Button Color"
  913.       Top             =   1200
  914.       Width           =   495
  915.    End
  916.    Begin VB.PictureBox LeftColor 
  917.       BackColor       =   &H80000007&
  918.       Height          =   495
  919.       Left            =   4920
  920.       ScaleHeight     =   435
  921.       ScaleWidth      =   435
  922.       TabIndex        =   1
  923.       ToolTipText     =   "Left Button Color"
  924.       Top             =   1200
  925.       Width           =   495
  926.    End
  927.    Begin VB.PictureBox grid 
  928.       Appearance      =   0  'Flat
  929.       AutoRedraw      =   -1  'True
  930.       BackColor       =   &H80000005&
  931.       ForeColor       =   &H80000008&
  932.       Height          =   4832
  933.       Left            =   0
  934.       ScaleHeight     =   4800
  935.       ScaleWidth      =   4800
  936.       TabIndex        =   0
  937.       Top             =   1200
  938.       Width           =   4832
  939.       Begin VB.Shape shCapture 
  940.          BorderColor     =   &H00FF0000&
  941.          BorderStyle     =   4  'Dash-Dot
  942.          Height          =   495
  943.          Left            =   2160
  944.          Top             =   1560
  945.          Visible         =   0   'False
  946.          Width           =   375
  947.       End
  948.       Begin VB.Shape shRect 
  949.          Height          =   15
  950.          Left            =   0
  951.          Top             =   0
  952.          Visible         =   0   'False
  953.          Width           =   15
  954.       End
  955.       Begin VB.Line shLine 
  956.          Visible         =   0   'False
  957.          X1              =   0
  958.          X2              =   0
  959.          Y1              =   0
  960.          Y2              =   0
  961.       End
  962.       Begin VB.Shape shCircle 
  963.          Height          =   15
  964.          Left            =   1320
  965.          Shape           =   3  'Circle
  966.          Top             =   1800
  967.          Visible         =   0   'False
  968.          Width           =   15
  969.       End
  970.    End
  971.    Begin VB.Label Label5 
  972.       Caption         =   "Text:"
  973.       Height          =   255
  974.       Left            =   5640
  975.       TabIndex        =   32
  976.       Top             =   285
  977.       Width           =   735
  978.    End
  979.    Begin VB.Label Label4 
  980.       Caption         =   "Clip"
  981.       Height          =   255
  982.       Left            =   5520
  983.       TabIndex        =   28
  984.       Top             =   5520
  985.       Width           =   495
  986.    End
  987.    Begin VB.Label Label1 
  988.       Caption         =   "Icon"
  989.       Height          =   255
  990.       Left            =   5520
  991.       TabIndex        =   21
  992.       Top             =   5040
  993.       Width           =   615
  994.    End
  995.    Begin VB.Menu mnuFile 
  996.       Caption         =   "&File"
  997.       Begin VB.Menu mnuFileOpen 
  998.          Caption         =   "&Open"
  999.       End
  1000.       Begin VB.Menu mnuFileSave 
  1001.          Caption         =   "&Save"
  1002.       End
  1003.       Begin VB.Menu mnuFileExit 
  1004.          Caption         =   "&Exit"
  1005.       End
  1006.    End
  1007. Attribute VB_Name = "frmMain"
  1008. Attribute VB_GlobalNameSpace = False
  1009. Attribute VB_Creatable = False
  1010. Attribute VB_PredeclaredId = True
  1011. Attribute VB_Exposed = False
  1012. '***********************************************
  1013. '     Many thanks to Burt Abreau and his fine
  1014. '     website (www.vbexplorer.com) for pointing
  1015. '     me in the right direction.
  1016. '***********************************************
  1017. '        Written in Visual Basic 5.0
  1018. 'Hello fellow VB programmers.  Like many projects,
  1019. 'this grew out of a need for an icon designer that
  1020. 'would do what I wanted it to do--vice what someone
  1021. 'else had in mind.  I had been working on another
  1022. 'project which needed customized icons.  I searched
  1023. 'the net but couldn't find an icon editor that
  1024. 'would do what I wanted, so I put the other project
  1025. 'on hold while I wrote this.  It started out bare
  1026. 'bones, but you know how that goes.
  1027. 'I didn't write a help file but here are some notes,
  1028. 'not in any order:
  1029. '(1) Note that a doubleclick on the last 16 color
  1030. 'boxes will let you define your own color.
  1031. '(2) The first 16 colors are solid colors and
  1032. 'react to all modes normally.  However, the 2nd
  1033. 'group contains mixed colors & you will see the
  1034. 'results if you draw a solid shape or clear to
  1035. 'those colors.
  1036. '(3) The Clear command button clears to the left
  1037. 'color if left clicked & vice versa.
  1038. '(4) I beat myself to death trying to get the
  1039. 'ExtFloodFill API call to work until I finally
  1040. 'figured out that you have to invoke
  1041. '      Picture1.Picture = Picture1.Image
  1042. '---whatever that does.
  1043. '(5) I think ICONWRKS, which came with VB3 would do
  1044. 'what I wanted, but in spite of my tweaking & converting
  1045. 'to 32 bit, it 'illegal ops' on the GetBitMapBits call.
  1046. 'Anyone know how to fix it?
  1047. 'Do what you want with this source, however check it
  1048. 'out carefully before you run it.  I cannot know about
  1049. 'every person's PC setup & will not be held liable
  1050. 'if it locks up your machine and wipes out your drive.
  1051. 'I sincerely doubt this will happen, but who knows?
  1052. 'Questions/comments to me (Norm Cook):
  1053. '          guinn@netjava.com
  1054. 'Be happy in your programming
  1055. Option Explicit
  1056. Private Declare Function ExtFloodFill Lib "gdi32" _
  1057.  (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, _
  1058.   ByVal crColor As Long, ByVal wFillType As Long) As Long
  1059. Const FLOODFILLSURFACE = 1
  1060. Dim miStartX%, miStartY%  'define position at mousedown
  1061. Dim miMoveX%, miMoveY%    '  "      "       " mousemove
  1062. Dim miCapX1%, miCapY1%    'define capture coordinates
  1063. Dim miCapX2%, miCapY2%
  1064. Dim miMode%               'mode
  1065. Const PENCILMODE = 0
  1066. Const LINEMODE = 1
  1067. Const RECTMODE = 2
  1068. Const RECTFILLMODE = 3
  1069. Const CIRCMODE = 4
  1070. Const CIRCFILLMODE = 5
  1071. Const TEXTMODE = 6
  1072. Const FLOODMODE = 7
  1073. Const CAPTUREMODE = 8
  1074. Const PASTEMODE = 9
  1075. Private Sub Form_Load()
  1076.  Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2
  1077.  Init
  1078.  picModeSel_Click 0       'set pencil mode
  1079.  cmdGrid_Click      'remove to start up without grid
  1080. End Sub
  1081. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1082.  'clear out grid coordinates when mouse leaves grid
  1083.  SBar.Panels(3).Text = ""
  1084.  UpdateSBar
  1085. End Sub
  1086. Private Sub Form_Unload(Cancel As Integer)
  1087.  Set frmMain = Nothing    'return memory to system
  1088. End Sub
  1089. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  1090.  Unload Me
  1091. End Sub
  1092. Private Sub Init()
  1093.  Dim i%
  1094.  For i = 0 To 15
  1095.   Color(i).BackColor = QBColor(i)
  1096.  Next
  1097.  For i = 31 To 47
  1098.   Color(i).ToolTipText = "Doubleclick for custom colors"
  1099.  Next
  1100.  SBar.Panels.Add
  1101.  SBar.Panels.Add
  1102.  SBar.Panels(1).Width = Width * 0.7
  1103.  SBar.Panels(2).Width = Width * 0.1
  1104.  SBar.Panels(3).Width = Width * 0.2
  1105.  UpdateSBar
  1106. End Sub
  1107. Private Sub UpdateSBar()
  1108.  SBar.Panels(2).Text = Format$(Now, "short time")
  1109. End Sub
  1110. 'Used to plot a square on the main grid
  1111. ' as well as the ikon
  1112. Private Sub Plot(ByVal X%, ByVal Y%, ByVal c&)
  1113.  If cmdGrid.Caption = "&Grid" Then
  1114.     'without grid=>larger box
  1115.   grid.Line (X, Y)-(X + 140, Y + 140), c, BF
  1116.  Else
  1117.     'with grid=>smaller, so that grid lines visible
  1118.   grid.Line (X + 10, Y + 10)-(X + 130, Y + 130), c, BF
  1119.  End If
  1120.  Ikon.PSet (X \ 150, Y \ 150), c
  1121. End Sub
  1122. Private Sub Color_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  1123.  'color select
  1124.  If Button = 1 Then
  1125.   LeftColor.BackColor = Color(Index).BackColor
  1126.  Else
  1127.   RightColor.BackColor = Color(Index).BackColor
  1128.  End If
  1129. End Sub
  1130. Private Sub Color_DblClick(Index As Integer)
  1131.  If Index > 31 Then
  1132.   cd.ShowColor
  1133.   If Err <> 32755 Then
  1134.    Color(Index).BackColor = cd.Color
  1135.   End If
  1136.  End If
  1137. End Sub
  1138. 'These 3 routines, mousedown, mousemove & mouseup
  1139. ' are the meat of the program
  1140. Private Sub grid_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1141.  Dim c&
  1142.  miStartX = X: miStartY = Y
  1143.   'get color for subsequent ops
  1144.  If Button = 1 Then c = LeftColor.BackColor Else c = RightColor.BackColor
  1145.  Select Case miMode
  1146.   Case PENCILMODE
  1147.    Plot 150 * miMoveX, 150 * miMoveY, c
  1148.   Case CIRCMODE, CIRCFILLMODE
  1149.    shCircle.Visible = True
  1150.   Case LINEMODE
  1151.    shLine.Visible = True
  1152.   Case RECTMODE, RECTFILLMODE
  1153.    shRect.Visible = True
  1154.   Case TEXTMODE
  1155.   Case CAPTUREMODE
  1156.    shCapture.Visible = True
  1157.  End Select
  1158. End Sub
  1159. Private Sub grid_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1160.  Dim strx$, stry$
  1161.  UpdateSBar
  1162.  grid.MousePointer = vbCrosshair
  1163.  miMoveX = X \ 150: miMoveY = Y \ 150
  1164.  'build coordinates message for status bar
  1165.  strx = "X: " & Right$("0" & CStr(miMoveX), 2)
  1166.  stry = "Y: " & Right$("0" & CStr(miMoveY), 2)
  1167.  SBar.Panels(3).Text = strx & "       " & stry
  1168.  If Button Then 'nothing else happens if mouse
  1169.   Dim c&        ' not being dragged
  1170.   If Button = 1 Then  'left button
  1171.    c = LeftColor.BackColor
  1172.   Else
  1173.    c = RightColor.BackColor
  1174.   End If
  1175.   Select Case miMode
  1176.    Case PENCILMODE
  1177.     'having pencilmode in the mousemove event
  1178.     'allows freehand draw
  1179.     If Shift Then 'ctrl , alt or shift
  1180.      'the following allows a straight line
  1181.      'while the shift key is down
  1182.      If Abs(X - miStartX) > Abs(Y - miStartY) Then
  1183.        miMoveY = miStartY \ 150
  1184.      Else
  1185.        miMoveX = miStartX \ 150
  1186.      End If
  1187.     End If
  1188.     Plot 150 * miMoveX, 150 * miMoveY, c
  1189.    Case CIRCMODE, CIRCFILLMODE
  1190.     Dim radius%
  1191.     'compute radius
  1192.     radius = Sqr(Abs(miStartX - X) ^ 2 + Abs(miStartY - Y) ^ 2)
  1193.     'shCircle is a shape defined as a circle
  1194.     'and allows user to preview the circle
  1195.     shCircle.Width = 2 * radius
  1196.     shCircle.Height = 2 * radius
  1197.     shCircle.Left = miStartX - radius
  1198.     shCircle.Top = miStartY - radius
  1199.    Case LINEMODE
  1200.     'shLine allows preview of line
  1201.     shLine.X1 = miStartX
  1202.     shLine.Y1 = miStartY
  1203.     shLine.X2 = X
  1204.     shLine.Y2 = Y
  1205.    Case RECTMODE, RECTFILLMODE
  1206.     'following two lines allow user to drag box
  1207.     'in any direction
  1208.     shRect.Left = -miStartX * (X > miStartX) - _
  1209.                   X * (X <= miStartX)
  1210.     shRect.Top = -miStartY * (Y > miStartY) - _
  1211.                   Y * (Y <= miStartY)
  1212.     shRect.Width = Abs(miStartX - X)
  1213.     shRect.Height = Abs(miStartY - Y)
  1214.    Case TEXTMODE
  1215.     'nothing to do
  1216.    Case CAPTUREMODE
  1217.     'same coding as for rectangle
  1218.     'just uses a rectangle shape with dashed border
  1219.     shCapture.Left = -miStartX * (X > miStartX) - _
  1220.                   X * (X <= miStartX)
  1221.     shCapture.Top = -miStartY * (Y > miStartY) - _
  1222.                   Y * (Y <= miStartY)
  1223.     shCapture.Width = Abs(miStartX - X)
  1224.     shCapture.Height = Abs(miStartY - Y)
  1225.   End Select
  1226.  End If     'if Button
  1227. End Sub
  1228. 'This is where the actual drawing occurs.  When
  1229. ' this is fired, miStartX/miStartY define where
  1230. ' the mouse went down and X/Y define where
  1231. ' it is now
  1232. Private Sub grid_MouseUp(Button As Integer, _
  1233.  Shift As Integer, X As Single, Y As Single)
  1234.  Dim c&
  1235.  'get color for subsequent ops
  1236.  If Button = 1 Then
  1237.     c = LeftColor.BackColor
  1238.  Else
  1239.     c = RightColor.BackColor
  1240.  End If
  1241.  Select Case miMode
  1242.   Case CIRCMODE, CIRCFILLMODE
  1243.    If miMode = CIRCMODE Then
  1244.     Ikon.FillStyle = 1  'unfilled
  1245.    Else
  1246.     Ikon.FillStyle = 0  'filled
  1247.    End If
  1248.    Ikon.FillColor = c
  1249.     'radius is just shCircle's width or height / 2
  1250.    Ikon.Circle (miStartX \ 150, miStartY \ 150), shCircle.Width / 300, c
  1251.    Ikon2Grid
  1252.    'setting the shapes & lines to minimum
  1253.    'height/width precludes having them jump
  1254.    'back to previous size when made visible again
  1255.    shCircle.Width = 0
  1256.    shCircle.Height = 0
  1257.    shCircle.Visible = False
  1258.   Case LINEMODE
  1259.    'shLine is actually a line and not a shape
  1260.    ' its X1,Y1,X2,Y2 properties make it easy
  1261.    ' to define the line parameters
  1262.    Ikon.Line (shLine.X1 \ 150, shLine.Y1 \ 150)-(shLine.X2 \ 150, shLine.Y2 \ 150), c
  1263.    'the line drawing routine does not set the
  1264.    ' final point, so the following is necessary
  1265.    Ikon.PSet (shLine.X2 \ 150, shLine.Y2 \ 150), c
  1266.    Ikon2Grid
  1267.    shLine.X1 = 0: shLine.Y1 = 0: shLine.X2 = 0: shLine.Y2 = 0
  1268.    shLine.Visible = False
  1269.   Case RECTMODE, RECTFILLMODE
  1270.    If miMode = RECTMODE Then
  1271.      'for some reason, vbTransparent
  1272.      'equates to zero, so...
  1273.      Ikon.FillStyle = 1
  1274.      Ikon.Line (miStartX \ 150, miStartY \ 150)-(X \ 150, Y \ 150), c, B
  1275.    Else
  1276.      Ikon.FillStyle = vbSolid
  1277.      Ikon.Line (miStartX \ 150, miStartY \ 150)-(X \ 150, Y \ 150), c, BF
  1278.    End If
  1279.    Ikon2Grid
  1280.    shRect.Width = 0: shRect.Height = 0
  1281.    shRect.Visible = False
  1282.   Case TEXTMODE
  1283.    'try to center the letter on the mouseup coord
  1284.    Ikon.CurrentX = X \ 150 - (Ikon.TextWidth(txtAlpha)) / 2
  1285.    Ikon.CurrentY = Y \ 150 - (Ikon.TextHeight(txtAlpha)) / 2
  1286.    Ikon.ForeColor = c
  1287.    Ikon.Print txtAlpha
  1288.    Ikon2Grid
  1289.   Case FLOODMODE
  1290.    'I've tried many times to write a flood fill
  1291.    ' routine with little success.  The API call
  1292.    ' below does it well
  1293.    Dim Result&
  1294.    Ikon.FillStyle = vbSolid
  1295.    Ikon.FillColor = c
  1296.    Ikon.Picture = Ikon.Image
  1297.    Result = ExtFloodFill(Ikon.hdc, miStartX \ 150, _
  1298.             miStartY \ 150, _
  1299.             Ikon.Point(X \ 150, Y \ 150), _
  1300.             FLOODFILLSURFACE)
  1301.    Ikon2Grid
  1302.   Case CAPTUREMODE
  1303.    cmdCopy.Enabled = True
  1304.    cmdCut.Enabled = True
  1305.   Case PASTEMODE
  1306.    'This could be simplified by having the
  1307.    'cmdCut & cmdCopy routines define
  1308.    'miCapWidth & miCapHeight
  1309.    Ikon.PaintPicture picCap.Image, X \ 150, Y \ 150, _
  1310.     miCapX2 - miCapX1 + 1, miCapY2 - miCapY1 + 1, _
  1311.     0, 0, miCapX2 - miCapX1 + 1, miCapY2 - miCapY1 + 1
  1312.    Ikon2Grid
  1313.    shCapture.Width = 0: shCapture.Height = 0
  1314.    shCapture.Visible = False
  1315.  End Select
  1316. End Sub
  1317. Private Sub mnuFileExit_Click()
  1318.  'Here, if desired, one could add some code
  1319.  'to see if the user wants to save the drawing.
  1320.  Unload Me      'fini
  1321. End Sub
  1322. Private Sub mnuFileOpen_Click()
  1323.  cd.Filter = "Icon Files (*.ico)|*.ico"
  1324.  cd.ShowOpen
  1325.  If Err <> 32755 Then
  1326.   Caption = "Icon32 - " & cd.filename
  1327.   Ikon.Picture = LoadPicture(cd.filename)
  1328.   Ikon2Grid
  1329.  End If
  1330. End Sub
  1331. 'Workhorse routine: transfers ikon's picture
  1332. ' to the grid
  1333. Private Sub Ikon2Grid()
  1334.  Dim X%, Y%
  1335.  For Y = 0 To 31
  1336.   For X = 0 To 31
  1337.    Plot 150 * X, 150 * Y, Ikon.Point(X, Y)
  1338.   Next
  1339.  Next
  1340. End Sub
  1341. Private Sub mnuFileSave_Click()
  1342.  Dim nam$
  1343.  nam = cd.filename
  1344.  cd.Filter = "Icon Files (*.ico)|*.ico"
  1345.  cd.Flags = cdlOFNOverwritePrompt
  1346.  cd.ShowSave
  1347.  If Err <> 32755 Then 'i.e. if user didn't cancel
  1348.     If nam <> cd.filename Then
  1349.        Caption = "Icon32 - " & cd.filename
  1350.     End If
  1351.     Ikon.Picture = Ikon.Image
  1352.     SavePicture Ikon.Picture, cd.filename
  1353.  End If
  1354. End Sub
  1355. 'This one's fairly self-explanatory
  1356. Private Sub cmdShift_Click(Index As Integer)
  1357.  Select Case Index
  1358.   Case 0
  1359.    ShiftRight
  1360.   Case 1
  1361.    ShiftLeft
  1362.   Case 2
  1363.    ShiftUp
  1364.   Case 3
  1365.    ShiftDown
  1366.   Case 4
  1367.    ShiftUp
  1368.    ShiftLeft
  1369.   Case 5
  1370.    ShiftUp
  1371.    ShiftRight
  1372.   Case 6
  1373.    ShiftDown
  1374.    ShiftLeft
  1375.   Case 7
  1376.    ShiftDown
  1377.    ShiftRight
  1378.  End Select
  1379.  Ikon2Grid
  1380. End Sub
  1381. 'This and the following 6 routines just
  1382. 'took a little math trial & error
  1383. Private Sub ShiftRight()
  1384.  Dim X%, Y%
  1385.    For Y = 0 To 31
  1386.    For X = 31 To 1 Step -1
  1387.     Ikon.PSet (X, Y), Ikon.Point(X - 1, Y)
  1388.    Next
  1389.    Ikon.PSet (0, Y), QBColor(15)
  1390.    Next
  1391. End Sub
  1392. Private Sub ShiftLeft()
  1393.  Dim X%, Y%
  1394.    For Y = 0 To 31
  1395.    For X = 0 To 30
  1396.     Ikon.PSet (X, Y), Ikon.Point(X + 1, Y)
  1397.    Next
  1398.    Ikon.PSet (31, Y), QBColor(15)
  1399.    Next
  1400. End Sub
  1401. Private Sub ShiftUp()
  1402.  Dim X%, Y%
  1403.    For X = 0 To 31
  1404.    For Y = 0 To 30
  1405.     Ikon.PSet (X, Y), Ikon.Point(X, Y + 1)
  1406.    Next
  1407.    Ikon.PSet (X, 31), QBColor(15)
  1408.    Next
  1409. End Sub
  1410. Private Sub ShiftDown()
  1411.  Dim X%, Y%
  1412.    For X = 0 To 31
  1413.    For Y = 31 To 1 Step -1
  1414.     Ikon.PSet (X, Y), Ikon.Point(X, Y - 1)
  1415.    Next
  1416.    Ikon.PSet (X, 0), QBColor(15)
  1417.    Next
  1418. End Sub
  1419. Private Sub cmdFlipH_Click()
  1420.  Dim X%, Y%, w&(0 To 31, 0 To 31)
  1421.  For Y = 0 To 31
  1422.   For X = 0 To 31
  1423.    w(X, Y) = Ikon.Point(X, Y)
  1424.   Next
  1425.  Next
  1426.  For Y = 0 To 31
  1427.   For X = 31 To 0 Step -1
  1428.    Ikon.PSet (X, Y), w(31 - X, Y)
  1429.   Next
  1430.  Next
  1431.  Ikon2Grid
  1432. End Sub
  1433. Private Sub cmdFlipV_Click()
  1434.  Dim X%, Y%, w&(0 To 31, 0 To 31)
  1435.  For Y = 0 To 31
  1436.   For X = 0 To 31
  1437.    w(X, Y) = Ikon.Point(X, Y)
  1438.   Next
  1439.  Next
  1440.  For Y = 31 To 0 Step -1
  1441.   For X = 0 To 31
  1442.    Ikon.PSet (X, Y), w(X, 31 - Y)
  1443.   Next
  1444.  Next
  1445.  Ikon2Grid
  1446. End Sub
  1447. Private Sub cmdRotate_Click()
  1448.  Dim X%, Y%, w&(0 To 31, 0 To 31)
  1449.  For Y = 0 To 31
  1450.   For X = 0 To 31
  1451.    w(X, Y) = Ikon.Point(X, Y)
  1452.   Next
  1453.  Next
  1454.  For Y = 0 To 31
  1455.   For X = 0 To 31
  1456.    Ikon.PSet (Y, X), w(X, Y)
  1457.   Next
  1458.  Next
  1459.  Ikon2Grid
  1460. End Sub
  1461. Private Sub cmdClear_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1462.  Dim c&
  1463.  If Button = 1 Then
  1464.   c = LeftColor.BackColor
  1465.  Else
  1466.   c = RightColor.BackColor
  1467.  End If
  1468.  Ikon.Line (0, 0)-(31, 31), c, BF
  1469.  Ikon2Grid
  1470. End Sub
  1471. Private Sub cmdCopy_Click()
  1472.  cmdPaste.Enabled = True
  1473.  cmdCopy.Enabled = False
  1474.  cmdCut.Enabled = False
  1475.  With shCapture
  1476.   .Visible = False
  1477.   miCapX1 = .Left \ 150
  1478.   miCapY1 = .Top \ 150
  1479.   miCapX2 = (.Left + .Width) \ 150
  1480.   miCapY2 = (.Top + .Height) \ 150
  1481.  End With
  1482.  picCap.Cls
  1483.  picCap.PaintPicture Ikon.Image, 0, 0, miCapX2 - miCapX1 + 1, miCapY2 - miCapY1 + 1, miCapX1, miCapY1, miCapX2 - miCapX1 + 1, miCapY2 - miCapY1 + 1
  1484. End Sub
  1485. Private Sub cmdCut_Click()
  1486.  cmdCopy_Click
  1487.  Ikon.Line (miCapX1, miCapY1)-(miCapX2, miCapY2), QBColor(15), BF
  1488.  Ikon2Grid
  1489. End Sub
  1490. Private Sub cmdPaste_Click()
  1491.  picMode.Picture = cmdPaste.Picture
  1492.  cmdCopy.Enabled = False
  1493.  cmdCut.Enabled = False
  1494.  miMode = PASTEMODE
  1495. End Sub
  1496. Private Sub cmdGrid_Click()
  1497.  If cmdGrid.Caption = "&Grid" Then
  1498.   cmdGrid.Caption = "&No Grid"
  1499.   Dim i%
  1500.   For i = 0 To 31   'draw the grid
  1501.    grid.Line (0, 150 * i)-(4799, 150 * i), 0
  1502.    grid.Line (150 * i, 0)-(150 * i, 4799), 0
  1503.   Next
  1504.  Else
  1505.   cmdGrid.Caption = "&Grid"
  1506.   grid.Cls          'clear out everything
  1507.   Ikon2Grid         'redraw the picture
  1508.  End If
  1509. End Sub
  1510. Private Sub cmdFont_Click()
  1511.  cd.Flags = cdlCFBoth Or cdlCFEffects
  1512.  'show printer & screen fonts
  1513.  cd.FontName = "Ms Sans Serif"
  1514.  cd.ShowFont
  1515.  If Err <> 32755 Then
  1516.   cmdFont.Caption = cd.FontName
  1517.   txtAlpha.Font = cd.FontName
  1518.   txtAlpha.ForeColor = cd.Color
  1519.   txtAlpha.FontItalic = cd.FontItalic
  1520.   txtAlpha.FontBold = cd.FontBold
  1521.   'could also change the textbox fontsize
  1522.   'but would require manipulating its height
  1523.   Ikon.Font = cd.FontName
  1524.   Ikon.FontSize = cd.FontSize
  1525.   Ikon.FontItalic = cd.FontItalic
  1526.   Ikon.FontBold = cd.FontBold
  1527.  End If
  1528. End Sub
  1529. Private Sub picModeSel_Click(Index As Integer)
  1530.  'handles a click on any of the modes
  1531.  miMode = Index
  1532.  picMode.Picture = picModeSel(Index).Picture
  1533.  SBar.Panels(1).Text = picModeSel(Index).ToolTipText
  1534.  UpdateSBar
  1535.  cmdPaste.Enabled = False
  1536.  cmdCut.Enabled = False
  1537.  cmdCopy.Enabled = False
  1538.  shCapture.Visible = False
  1539.    'in case the user selected an area, then
  1540.    ' changed modes
  1541. End Sub
  1542. Private Sub txtAlpha_GotFocus()
  1543.  'saves the user a mouseclick
  1544.  picModeSel_Click TEXTMODE
  1545. End Sub
  1546.